/*
*Copyright 2021-2023 NERCIS
*
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*See the License for the specific language governing permissions and
*limitations under the License.
*/

package cn.ac.nercis.pes.common.constant.evaluation;

import cn.ac.nercis.pes.common.constant.project.SecurityLevel;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * 物理安防设施安全需求
 *
 * @author zpy
 * @version v1.0.0
 */
public enum AssetPhySecurityReq {
    /**身份鉴别**/
    AUTH("身份鉴别"),
    ELECTRONIC("电子门禁记录数据存储完整性"),
    VIDEO("视频监控记录数据存储完整性");

    private final String name;
    AssetPhySecurityReq(String name) {
        this.name = name;
    }

    public String getName(){
        return this.name;
    }

    public static List<String> getReqNames(SecurityLevel level){
        if(level == SecurityLevel.THREE){
            return Stream.of(AUTH, ELECTRONIC, VIDEO)
                    .map(AssetPhySecurityReq::getName)
                    .collect(Collectors.toList());
        }else{
            return Stream.of(AUTH, ELECTRONIC)
                    .map(AssetPhySecurityReq::getName)
                    .collect(Collectors.toList());
        }
    }
}